# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=massexpconsole
pkgver=v2.3.5.r1.g530c880
pkgrel=6
epoch=1
pkgdesc='A collection of tools and exploits with a cli ui for mass exploitation.'
groups=('blackarch' 'blackarch-automation' 'blackarch-exploitation')
arch=('any')
url='https://github.com/jm33-m0/massExpConsole'
license=('GPL3')
depends=('python' 'python-requests' 'python-beautifulsoup4' 'python-psutil'
         'python-pyopenssl' 'python-html5lib' 'python-docopt' 'python-tqdm'
         'python-prompt_toolkit')
makedepends=('git')
source=("$pkgname::git+https://github.com/jm33-m0/mec.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/$pkgname/LICENSE"

  rm README.md LICENSE

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python mec.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

